<?php
    include_once('Configs/database.php');
    class Quyen extends database{
        public $maquyen;
        public $diengiai;
        public function setMaQuyen($maquyen){
            $this->maquyen = $maquyen;
        }
        public function getMaQuyen(){
            return $this->maquyen;
        }
        public function setDienGiai($diengiai){
            $this->diengiai = $diengiai;
        }
        public function getDienGiai(){
            return $this->diengiai;
        }
        public function dsQuyen(){
            $this->setQuery("select distinct * from Quyen");
            return $this->fetchAll();
        }
        public function dsChucNangQuenThucHien(){
            $query = "select b.macn,tencn,parent ";
            $query .= "from Quyen a,ThucHien b, ChucNang c ";
            $query .= "where a.maquyen='".$this->getMaQuyen()."' and a.maquyen= b.maquyen and b.macn = c.macn  order by tencn";
            $this->setQuery($query);
            //echo $this->getQuery();
            return $this->fetchAll();
        }
    }

?>